const app = getApp();
const WxParse = require('../../../wxParse/wxParse.js');
Page({
  data: {

  },
  onLoad: function (options) {
    let that = this;
    if (options.scene) {
      let  str = decodeURIComponent(options.scene);
      let scene = [];
      let  arr = str.split('&');
        for (let  i = 0; i < arr.length; i++) {
          let  s = arr[i].split('=');
          scene[s[0]] = s[1];
        }
      options.id = scene.id;
    }
    let service_id = options.id;
    app.request('service/serviceDetail', { service_id },'GET',false,function(res){
      wx.setStorageSync('goodsDetail', res.data.data)
      that.setData({
        detail: res.data.data,
        pageShow: true,
        editor: WxParse.wxParse('editor', 'html', res.data.data.detail, that, 5),
        shareLink: "/pages/poster/poster_service/poster_service?id="+service_id,
      })
    })
  },
  // 分享
  share: function (e) {
    var that = this;
    that.setData({
      shareShow: true,
      maskShow: true,
    })
  },
  maskHide(e){
    let that = this;
    that.setData({
      maskShow:false,
      shareShow: false,
    })
  },
  makePhoneCall(e){
    let that = this;
    app.confirmTap(function(){
      wx.makePhoneCall({
        phoneNumber: e.currentTarget.dataset.phone,
      })
    })
  },
  getFormid(e) {
    app.getFormid(e);
  },
  onShow: function () {

  },
  onReachBottom: function () {

  },
  onShareAppMessage: function () {

  }
})